<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<base href="<%=basePath%>"/>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>青鸟租房 - 用户登录</title>
	<link type="text/css" rel="stylesheet" href="css/style.css" />
	<script type="text/javascript" src="scripts/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="scripts/function.js"></script>
	<script type="text/javascript">
	$(function(){
		$("form :input").blur(function (){
			var $parent = $(this).parent();
			$parent.find(".tip").remove();
			if ($(this).is("#username")){
				if (this.value.length<3){
					var errorMsg = "请输入至少三位的用户名";
					$parent.append("<span class='tip'>" + errorMsg + "</span>");
				}
			}
			if ($(this).is("#password")){
				if (this.value.length<=0){
					var errorMsg = "密码不能为空";
					$parent.append("<span class='tip'>" + errorMsg + "</span>");
				}
			}
		});
		$("form").submit(function (){
			$("form :input").trigger("blur");
			var numError = $(".tip").length;
			if (numError == 0) {
				return true;
			} else {
				return false;
			}
		});
	});
	</script>
	</head>
	<body>
<div id="header" class="wrap">
      <div id="logo"><img src="images/logo.gif" /></div>
    </div>
<div id="regLogin" class="wrap">
      <div class="dialog">
    <div class="box">
          <h4>用户登录</h4>
          <form action="login.action" method="post">
        <div class="infos">
              <table class="field">
            <tr>
                  <td id="message" colspan="2" >${message}</td>
                </tr>
            <tr>
                  <td class="field">用 户 名：</td>
                  <td><input id="username" type="text" class="text" name="userName" value="lisi" /></td>
                </tr>
            <tr>
                  <td class="field">密　　码：</td>
                  <td><input id="password" type="password" class="text" name="password" value="lisi" /></td>
                </tr>
          </table>
              <div class="buttons">
            <input id="login" type="submit" value="立即登录"/>
            <input type='button' value='注册' onclick='document.location="page/register.jsp"'/>
          </div>
            </div>
      </form>
        </div>
  </div>
    </div>
<div id="footer" class="wrap">
      <dl>
    <dt>青鸟租房 &copy; 2010 北大青鸟 京ICP证1000001号</dt>
    <dd>关于我们 · 联系方式 · 意见反馈 · 帮助中心</dd>
  </dl>
    </div>
</body>
</html>
